const mySql = require("mysql") 
const Connection = mySql.createConnection({
    host:"localhost",
    port:3306,
    user:"root",
    password:"1234321",
    database:"bawei"
})

Connection.connect();
module.exports.query = function(sql,params=[]){
    return new Promise((resolve,reject)=>{
        Connection.query(sql,params,(err,res)=>{
            if(err){
                reject(err)
            }else{
                resolve(res)
            }
        })
    })
}